package bosVM2.util;

import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Set;

//General purpose key/value map using HashMap as underlying data structure.
public class Map<K,V> {
	private HashMap<K,V> map;
	
	public Map()
	{
		map = new HashMap<K,V>();
	}
	
	public Map(HashMap<K,V> m)
	{
		System.out.println("ninja");
		map = new HashMap<K,V>(m);
	}
	
	public Map(Map<K,V> omap) {
		this(omap.map);
	}

	public int size()
	{
		return map.size();
	}
	
	public void put(K k, V v)
	{
		map.put(k, v);
	}
	
	public V get(K k)
	{
		return map.get(k);
	}
	
	public Set<Entry<K, V>> Entries() 
	{
		return map.entrySet();
	}
	
	public boolean containsValue(V v)
	{
		return map.containsValue(v);
	}
	
	public boolean containsKey(K k)
	{
		return map.containsKey(k);
	}	
	
	public String toString()
	{
		return map.values().toString();
	}
	
	public Set<K> getKeys()
	{
		return map.keySet();
	}
	
	private HashMap<K,V> getMap()
	{
		return map;
	}
	
	private void setMap(HashMap<K,V> map)
	{
		this.map = map;
	}
}
